#ifndef __SPRITE_H__
#define __SPRITE_H__

#include <d3d9.h>
#include <d3dx9.h>

#include "Texture.h"

class Sprite
{
private:
	LPD3DXSPRITE _SpriteHandler;
	LPWSTR fileName;

	int _TimeAni;
	int _TimeLocal;

	
	int _TempIndex;
	int _frameBegin;
	int _frameEnd;
	/*int _Width;
	int _Height;
	int _Count;
	int _SpritePerRow;*/

public:
	int _Index;

	Texture* texture;
	Sprite(LPD3DXSPRITE SpriteHandler, Texture* Texture, int TimeAnimation, int Index);
	~Sprite();

	void Next();
	void Reset();
	void ResetLeft();
	void Update(int DelTime);
	void Render(int X, int Y);
	void SetFrame(int frameBegine, int frameEnd)
	{
		_frameBegin = frameBegine;
		_frameEnd = frameEnd;
	}
};
#endif